# 求矩阵的欧式距离
import numpy as np
n = 100    # 样本数量
x = np.linspace(1,100,n)   # 点的横坐标
y = np.linspace(1,100,n)   # 点的纵坐标
dist = np.zeros([n,n])
for i in range(n):
    for j in range(n):
        dist[i,j] = np.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)    # numpy.sqrt()是用来开放的函数
print(dist)
